import request from '@/utils/request';
import {AxiosPromise} from 'axios';
import {CallbackLogForm, CallbackLogQuery, CallbackLogVO} from '@/api/kd/callbackLog/types';

/**
 * 查询快递回调记录列表
 * @param query
 * @returns {*}
 */

export const listCallbackLog = (query?: CallbackLogQuery): AxiosPromise<CallbackLogVO[]> => {
  return request({
    url: '/kd/callbackLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询快递回调记录详细
 * @param id
 */
export const getCallbackLog = (id: string | number): AxiosPromise<CallbackLogVO> => {
  return request({
    url: '/kd/callbackLog/' + id,
    method: 'get'
  });
};

/**
 * 新增快递回调记录
 * @param data
 */
export const addCallbackLog = (data: CallbackLogForm) => {
  return request({
    url: '/kd/callbackLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改快递回调记录
 * @param data
 */
export const updateCallbackLog = (data: CallbackLogForm) => {
  return request({
    url: '/kd/callbackLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除快递回调记录
 * @param id
 */
export const delCallbackLog = (id: string | number | Array<string | number>) => {
  return request({
    url: '/kd/callbackLog/' + id,
    method: 'delete'
  });
};
